AC_INIT(libnibble, 0.0.2, jmoore@zedstar.org)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/])
AM_CONFIG_HEADER([src/config.h])

AC_DEFINE([PROGNAME],["libnibble"],["An XML over DTMF library"])

AC_DEFINE([MAX_NUM_DIGITS],[1000],["Limit on DTMF digits"])

# set portaudio vars
#AC_DEFINE([SAMPLE_RATE],[22050],["sample rate"])
AC_DEFINE([SAMPLE_RATE],[8000],["sample rate"])
# not sure of this
AC_DEFINE([FRAMES_PER_BUFFER],[160],["frames per buffer"])
AC_DEFINE([NUM_CHANNELS],[1],["num channels"])
AC_DEFINE([DITHER_FLAG],[0],["dither flag"])
AC_DEFINE([PA_SAMPLE_TYPE],[paInt16],["pa sample type"])
AC_DEFINE([SAMPLE_SILENCE],[0],["sample silence"])


# --enable-debug flag
AC_ARG_ENABLE(debug,
    [  --enable-debug     Turn on debugging [[default=no]]],
    enable_debug="$enableval",
    enable_debug=no)

if test x$enable_debug = xyes ; then
    AC_DEFINE([DEBUG_MODE], [], [true])
fi


# Checks for programs.
AC_PROG_CC

# Checks for header files.
AC_HEADER_STDC

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC

# check for spandsp
PKG_CHECK_MODULES(SPANDSP, [spandsp])

# check for portaudio
PKG_CHECK_MODULES(PORTAUDIO, [portaudio-2.0])

# need to remove one of these

# check for sndfile
#PKG_CHECK_MODULES(SNDFILE, [sndfile])
# check for sndfile
PKG_CHECK_MODULES(AUDIOFILE, [audiofile])

# check for packedobjects
PKG_CHECK_MODULES(LIBPACKEDOBJECTS, [libpackedobjects >= 0.0.7])

# just create shared library
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_FILES([Makefile src/Makefile])

AC_OUTPUT
